<template>
  <ul class="todo-main">
    <transition-group
      appear
      enter-active-class="animate__animated animate__flash"
      leave-active-class="animate__animated animate__flash"
    >
      <my-item
        v-for="todoObj in todo"
        :key="todoObj.id"
        :todoVal="todoObj"
      ></my-item>
    </transition-group>
  </ul>
</template>

<script>
// 引入 animate样式库
import "animate.css";

import Item from "./MyItem";

export default {
  name: "MyList",
  props: ["todo"],
  components: {
    "my-item": Item,
  },
};
</script>

<style scoped>
/*List*/
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}
</style>
